package com.lwj;

import com.lwj.service.SpringUtil;
import net.sf.cglib.core.DebuggingClassWriter;
import org.mybatis.spring.annotation.MapperScan;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.autoconfigure.web.servlet.MultipartAutoConfiguration;
import org.springframework.context.ConfigurableApplicationContext;
import org.springframework.scheduling.annotation.EnableAsync;
import org.springframework.session.data.redis.config.annotation.web.http.EnableRedisHttpSession;
import springfox.documentation.swagger2.annotations.EnableSwagger2;


@SpringBootApplication(exclude = {MultipartAutoConfiguration.class},scanBasePackages={Application.BASE_PACKAGES})
@EnableSwagger2
@EnableAsync  //注意被注解的方法，如果是类内部调用，不会异步执行
@MapperScan("com.lwj.mapper")
@EnableRedisHttpSession(maxInactiveIntervalInSeconds = 3600,redisNamespace = "boot:session")
public class Application {
    //可以指定<context:component-scan>注解扫描包名。默认 启动类所在的包
    public static final String BASE_PACKAGES = "com.lwj";
    public static void main(String[] args) {
       // System.setProperty (DebuggingClassWriter.DEBUG_LOCATION_PROPERTY,  "F:\\1");  查看 Aspect静态代理生成的代理类
        ConfigurableApplicationContext context = SpringApplication.run(Application.class, args);
        SpringUtil.set(context);
    }
}
